#include <REGX52.H>

sbit LED = P2;

delay(unsigned char i)
{
	while(i--);
}

void main()
{
	unsigned int time,i;
	while(1)
	{
		for(time = 0;time < 100;time++)
		{
			for(i = 0;i < 20;i++)
			{	
				LED = 0;
				delay(time);
				LED = 1;					
				delay(100 - time);
			}
		}
		for(time = 100;time > 0;time--)
		{
			for(i = 0;i < 20;i++)
			{
				LED = 0;
				delay(time);
				LED = 1;
				delay(100 - time);			
			}
		}
	}
}